# -*- coding: utf-8 -*-
# @Time    : 2023/6/5 9:11
# @Author  : hyh
# @Email   : 935887145@qq.com
# @File    : share_page.py
# @Software: PyCharm
from pages.base_page import BasePage
from appium import webdriver
from tools import driver
from appium.webdriver.common.mobileby import MobileBy as By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import  expected_conditions as EC

class SharePage(BasePage):
    share_locator = (By.XPATH,'//*[@resource-id="com.xiachufang:id/ib_share"]')
    share_too_locator = (By.XPATH,'//*[@resource-id="com.xiachufang:id/tv_share_title"]')

    def share(self):    #点击分享按钮
        self.find_element(self.share_locator).click()

    def get_share_text(self):   #获取分享文字
        current_share_text = self.find_element(self.share_too_locator).get_attribute('text')
        return current_share_text
